<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>班级课表信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        $(document).ready(function() {
            $("#searchForm").validate({
                submitHandler: function(form){
                    loading('正在查询，请稍等...');
                    form.submit();
                }
            });
            $("#btnImport").click(function(){
                var classid = document.getElementById("classid").value;
                var classname = document.getElementById("classname").value;
                if (classid != "" && classname != "") {
                    $.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true},
                        bottomText:"导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"});
                } else {
                    top.$.jBox.tip("组织机构请选择班级节点，才可导入课表信息!");
                }
            });
        });
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
<div id="importBox" class="hide">
	<form id="importForm" action="${ctx}/biz/bizStudentTimetable/import" method="post" enctype="multipart/form-data"
		  class="form-search" style="padding-left:20px;text-align:center;" onsubmit="loading('正在导入，请稍等...');"><br/>
		<input id="uploadFile" name="file" type="file" style="width:330px"/><br/><br/>　　
		<input id="classid" name="classid" type="hidden" value="${bizStudentTimetable.classid}"/>
		<input id="classname" name="classname" type="hidden" value="${bizStudentTimetable.classname}"/>
		<input id="btnImportSubmit" class="btn btn-primary" type="submit" value="   导    入   " />
		<a href="${ctx}/biz/bizStudentTimetable/import/template">下载模板</a>
	</form>
</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/biz/bizStudentTimetable/">班级课表信息列表</a></li>
		<shiro:hasPermission name="biz:bizStudentTimetable:edit"><li><a href="${ctx}/biz/bizStudentTimetable/form">班级课表信息添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="bizStudentTimetable" action="${ctx}/biz/bizStudentTimetable/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>学年：</label>
				<input name="schoolyear" id="schoolyear" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					   value="${bizStudentTimetable.schoolyear}"
					   onclick="WdatePicker({dateFmt:'yyyy',isShowClear:true});" />
			</li>
			<li><label>星期几：</label>
				<form:select path="weekday" class="input-medium">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('weekday')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			</li>
			<li><label>班级：</label><sys:treeselect id="classid" name="classid" value="${bizStudentTimetable.classid}" labelName="classname" labelValue="${bizStudentTimetable.classname}"
												  title="班级" url="/sys/office/treeData?type=2" extId="200" cssClass="input-small" allowClear="true"/></li>
			<li><label>课程名称：</label>
				<form:input path="coursename" htmlEscape="false" maxlength="100" class="input-medium" />
			</li>
			<%--<li><label>学生身份证号：</label>
				<form:input path="studentidcard" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>--%>
			<li><label>上课教师：</label>
				<form:input path="teachername" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
				<input id="btnImport" class="btn btn-primary" type="button" value="导入"/>
			</li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>学年</th>
				<th>学期</th>
				<th>学周开始</th>
				<th>学周结束</th>
				<th>星期几</th>
				<th>课节</th>
				<th>课程名称</th>
				<th>班级名称</th>
				<th>上课教师</th>
				<th>上课地址</th>
				<shiro:hasPermission name="biz:bizStudentTimetable:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="bizStudentTimetable">
			<tr>
				<td><a href="${ctx}/biz/bizStudentTimetable/form?id=${bizStudentTimetable.id}">
						${bizStudentTimetable.schoolyear}
				</a></td>
				<td>
						${fns:getDictLabel(bizStudentTimetable.term, 'term', '无')}
				</td>
				<td>
						${fns:getDictLabel(bizStudentTimetable.weekstart, 'week', '无')}
				</td>
				<td>
						${fns:getDictLabel(bizStudentTimetable.weekend, 'week', '无')}
				</td>
				<td>
						${fns:getDictLabel(bizStudentTimetable.weekday, 'weekday', '无')}
				</td>
				<td>
						${fns:getDictLabel(bizStudentTimetable.section, 'section', '无')}
				</td>
				<td>
						${bizStudentTimetable.coursename}
				</td>
				<td>
						${bizStudentTimetable.classname}
				</td>
				<td>
						${bizStudentTimetable.teachername}
				</td>
				<td>
						${bizStudentTimetable.address}
				</td>
				<shiro:hasPermission name="biz:bizStudentTimetable:edit"><td>
    				<a href="${ctx}/biz/bizStudentTimetable/form?id=${bizStudentTimetable.id}">修改</a>
					<a href="${ctx}/biz/bizStudentTimetable/delete?id=${bizStudentTimetable.id}" onclick="return confirmx('确认要删除该学生课表信息吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>